package ru.tests.betterprogrammer;

/**
 * TODO: add description
 * Date: 12.08.11 22:13
 *
 * @author Alexander Troshanin
 */
public class Task1 {

    public static void main(String[] args) {

    }

    public static Object[] reverseArray(Object[] a) {
        /*
          Please implement this method to
          return a new array where the order of elements has been reversed from the original
          array.
         */
        if (a == null || a.length < 2) {
            return a;
        }
        for (int i = 0; i < a.length / 2; i++) {
            Object q = a[i];
            a[i] = a[(a.length - 1) - i];
            a[(a.length - 1) - i] = q;
        }
        return a;
    }

}
